package com.itheima.app.interceptor;

import com.itheima.domain.db.User;
// 线程内存储 user对象
public class UserHolder {

    private static final ThreadLocal<User> TLUSER = new ThreadLocal<>();

    //绑定
    public static void set(User user){
        TLUSER.set(user);
    }

    //获取
    public static User get(){
        return TLUSER.get();
    }

    //解绑
    public static void remove(){
        TLUSER.remove();
    }

}
